<?php

namespace app\admin\controller;

use app\common\model\Config as ConfigModel;

class Config extends Base
{
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * @return void
     * 获取所有角色
     */
    public function qiniu()
    {
        $data = [
            'qiniu_key' => 'Kn7OBaAfawpY1fGGkqybiHSkjRf7ceF7IvzpZ1vY',
            'qiniu_token' => 'pcUC3MHKoMumiGhEPCE12iUH2-Rn0GVYUkfjHHXM',
            'qiniu_url' => 'http://qiniu.xiyuezuqiu.cn/xiyuezuqiu/'
        ];
        return returnJson(0, '', $data);
    }

    /**
     * @return \think\response\Json
     */
    public function detail()
    {
        //查询条件
        $where = array(
            'name'=>input('name')
        );

        //获取配置项的植
        $data = ConfigModel::getValue($where,'value');

        //返回信息
        return returnJson(0, '', $data);
    }


}
